import java.io.*;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        File file=new File("test.txt");
        FileOutputStream fos=new FileOutputStream(file);
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        Student stu=new Student(2019591110,"冯宝宝",20,"女");
        oos.writeObject(stu);
        System.out.println("写入完成");
        oos.close();

    }
}
